using SalesPages.DomainModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class SEOHubContentMap : EntityTypeConfiguration<SEOHubContent>
    {
        public SEOHubContentMap()
        {
            // Primary Key
            this.HasKey(t => t.SeoHubContentId);

            // Properties
            this.Property(t => t.Locale)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.CategoryUrl)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.LinkText)
                .HasMaxLength(200);

            this.Property(t => t.PageUrl)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.MetaTitle)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.MetaDesc)
                .IsRequired()
                .HasMaxLength(600);

            this.Property(t => t.MetaKeywords)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.HeadLine1)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.Content1)
                .IsRequired()
                .HasMaxLength(3000);

            this.Property(t => t.Link1)
                .HasMaxLength(50);

            this.Property(t => t.ImgUrl1)
                .HasMaxLength(100);

            this.Property(t => t.HeadLine2)
                .HasMaxLength(200);

            this.Property(t => t.Content2)
                .HasMaxLength(3000);

            this.Property(t => t.Link2)
                .HasMaxLength(50);

            this.Property(t => t.ImgUrl2)
                .HasMaxLength(100);

            this.Property(t => t.HeadLine3)
                .HasMaxLength(200);

            this.Property(t => t.Content3)
                .HasMaxLength(3000);

            this.Property(t => t.Link3)
                .HasMaxLength(50);

            this.Property(t => t.ImgUrl3)
                .HasMaxLength(100);

            this.Property(t => t.HeadLine4)
                .HasMaxLength(200);

            this.Property(t => t.Content4)
                .HasMaxLength(3000);

            this.Property(t => t.Link4)
                .HasMaxLength(50);

            this.Property(t => t.ImgUrl4)
                .HasMaxLength(100);

            this.Property(t => t.ImgUrl)
                .HasMaxLength(100);

            this.Property(t => t.CustomLink1)
                .HasMaxLength(200);

            this.Property(t => t.CustomLinkText1)
                .HasMaxLength(200);

            this.Property(t => t.CustomLink2)
                .HasMaxLength(200);

            this.Property(t => t.CustomLinkText2)
                .HasMaxLength(200);

            this.Property(t => t.CustomLink3)
                .HasMaxLength(200);

            this.Property(t => t.CustomLinkText3)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("SEOHubContent");
            this.Property(t => t.SeoHubContentId).HasColumnName("SeoHubContentId");
            this.Property(t => t.SeoType).HasColumnName("SeoType");
            this.Property(t => t.PageRank).HasColumnName("PageRank");
            this.Property(t => t.Locale).HasColumnName("Locale");
            this.Property(t => t.CategoryUrl).HasColumnName("CategoryUrl");
            this.Property(t => t.LinkText).HasColumnName("LinkText");
            this.Property(t => t.PageUrl).HasColumnName("PageUrl");
            this.Property(t => t.MetaTitle).HasColumnName("MetaTitle");
            this.Property(t => t.MetaDesc).HasColumnName("MetaDesc");
            this.Property(t => t.MetaKeywords).HasColumnName("MetaKeywords");
            this.Property(t => t.HeadLine1).HasColumnName("HeadLine1");
            this.Property(t => t.Content1).HasColumnName("Content1");
            this.Property(t => t.Link1).HasColumnName("Link1");
            this.Property(t => t.ImgUrl1).HasColumnName("ImgUrl1");
            this.Property(t => t.HeadLine2).HasColumnName("HeadLine2");
            this.Property(t => t.Content2).HasColumnName("Content2");
            this.Property(t => t.Link2).HasColumnName("Link2");
            this.Property(t => t.ImgUrl2).HasColumnName("ImgUrl2");
            this.Property(t => t.HeadLine3).HasColumnName("HeadLine3");
            this.Property(t => t.Content3).HasColumnName("Content3");
            this.Property(t => t.Link3).HasColumnName("Link3");
            this.Property(t => t.ImgUrl3).HasColumnName("ImgUrl3");
            this.Property(t => t.HeadLine4).HasColumnName("HeadLine4");
            this.Property(t => t.Content4).HasColumnName("Content4");
            this.Property(t => t.Link4).HasColumnName("Link4");
            this.Property(t => t.ImgUrl4).HasColumnName("ImgUrl4");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.ImgUrl).HasColumnName("ImgUrl");
            this.Property(t => t.HubDisplayWay).HasColumnName("HubDisplayWay");
            this.Property(t => t.CustomLink1).HasColumnName("CustomLink1");
            this.Property(t => t.CustomLinkText1).HasColumnName("CustomLinkText1");
            this.Property(t => t.CustomLink2).HasColumnName("CustomLink2");
            this.Property(t => t.CustomLinkText2).HasColumnName("CustomLinkText2");
            this.Property(t => t.CustomLink3).HasColumnName("CustomLink3");
            this.Property(t => t.CustomLinkText3).HasColumnName("CustomLinkText3");
        }
    }
}
